//两两交换链表中的节点（递归）
class Solution {
public:
    ListNode* swapPairs(ListNode* head) {
        if(head == nullptr || head->next == nullptr)
            return head;

        ListNode* next = head->next;
        head->next = swapPairs(next->next);
        next->next = head;
        return next;
    }
};

//Pow(x,n)快速幂(递归)
class Solution {
public:
    double myPow(double x, int n) {
        return n < 0 ? 1 / Pow(x,-(long long)n) : Pow(x,n);
    }

    double Pow(double x, long long n)
    {
        if(n == 0)  return 1.0;
        double tmp = Pow(x,n/2);
        return n % 2 == 0 ? tmp * tmp : tmp * tmp * x;
    }
}:w
;
